function topics(
    topics = {
        page: 1,
        loading: false,
        list: [],
    },
    action
) {
    switch (action.type) {
        case "topics_update":
            return {
                loading: false,
                page: topics.page,
                list: action.data,
            };
        case "topics_loading":
            return {
                ...topics,
                loading: true,
            };
        case "topics_next":
            return {
                ...topics,
                page: topics.page + 1,
            };
        default:
            return topics;
    }
}

export default topics;
